<template>
  <div class="header">
    <div class="title">
      工具
    </div>
    <div
      class="closeBtn"
      :style="{backgroundImage: 'url('+closeImg+')'}"
      @click="handleClose"
    />
    <div
      class="smallBtn"
      :style="{backgroundImage: 'url('+smallImg+')'}"
      @click="handleSmall"
    />
  </div>
</template>

<script>
const { ipcRenderer } = window.require('electron')
export default {
  name: 'Header',
  data: () => {
    return {
      closeImg: require('../assets/close.png'),
      smallImg: require('../assets/tosmall.png')
    }
  },
  methods: {
    handleClose () {
      ipcRenderer.send('closeApp')
    },
    handleSmall () {
      ipcRenderer.send('min')
    }
  }
}
</script>

<style lang="scss" scoped>
.header{
  background-color: #292A2D !important;
  .title{
    height: 15px;
    line-height: 15px;
    float: left;
    margin: 10px;
    color: #919191;
    text-shadow: 2px 2px 5px #000;
  }
}
.closeBtn{
  height: 25px;
  width: 25px;
  float: right;
  margin: 5px 10px;
  background-repeat: no-repeat;
  background-size: cover;
  -webkit-background-size: cover;
  -o-background-size: cover;
  -webkit-app-region: no-drag !important;
}
.smallBtn{
  height: 25px;
  width: 25px;
  float: right;
  margin: 5px 10px;
  background-repeat: no-repeat;
  background-size: cover;
  -webkit-background-size: cover;
  -o-background-size: cover;
  -webkit-app-region: no-drag !important;
}
</style>
